import pandas as pd
import matplotlib.pyplot as plt


students = pd.read_excel("/Users/andy/Downloads/009/students.xlsx")

students.sort_values(by=2017, ascending=False, inplace=True)
students.plot.bar(x="Field", y=[2016,2017], color=["orange","red"])
plt.title("International Students by Field", fontsize=16, fontweight="bold")
ax = plt.gca()
#gca表示get current axis, 获取当前的轴信息
ax.set_xticklabels(students["Field"], rotation=45, ha="right")
#ha表示horizonal align, 水平对齐的位置
plt.xlabel("Year", fontweight="bold")
plt.ylabel("Number", fontweight="bold")
f = plt.gcf()
#gcf表示get current figure, 获取当前的图表信息
f.subplots_adjust(left=0.1, bottom=0.5)
#调整当前图表的边框大小
plt.show()






